package com.chentf.creational.factory.factory_method;


public class Client {

    public static void main(String[] args) {
        // 创建咖啡店对象
        CoffeeStore coffeeStore = new CoffeeStore();
        // 创建具体工厂对象
        CoffeeFactory factory = new AmericanCoffeeFactory();
        CoffeeFactory factory1 = new LatteCoffeeFactory();
        coffeeStore.setFactory(factory);
        coffeeStore.setFactory(factory1);
        // 点咖啡
        Coffee coffee = coffeeStore.orderCoffee();
        coffee.addMilk();
        coffee.addSugar();
    }
}
